# 1、递归实现二分查找法
"""
def func(lst, a, Min_index=0, Max_index=0):
    max_index = Max_index
    # print(max_index, lst)
    min_index = Min_index
    if lst[(max_index + min_index)//2] == a:
        return (max_index + min_index) // 2
    elif max_index - min_index == 1:
        return min_index, max_index
    else:
        if a < lst[(max_index + min_index)//2]:
            return func(lst, a, Min_index=min_index, Max_index=(max_index + min_index)//2)
        elif a > lst[(max_index + min_index)//2]:
            return func(lst, a, Min_index=(max_index + min_index)//2, Max_index=max_index)


lst2 = [1, 2, 3, 5, 6, 7]
print(func(lst2, 5, Max_index=len(lst2)-1, Min_index=0))
"""

# 2、合并列表
"""
lst1 = [0, 1, 2, 3, 4]
lst2 = [5, 6, 7, 8]

for i in lst2:
    lst1.append(i)

print(lst1)
"""
